<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
	$(document).ready(function(){
		$("#updateForm").submit(function(){
			if($(":password[name=password]").val()==""){
				alert("비밀번호를 입력하세요!");
				return false;
			} else if($(":text[name=name]").val()==""){
				alert("이름을 입력하세요!");
				return false;
			} else if($(":text[name=address]").val()==""){
				alert("주소를 입력하세요!");
				return false;
			}
		})
		$("#deleteForm").submit(function(){
			if(confirm("정말 탈퇴하시겠습니까?")==true){
				location.href="deleteconsumer.do";
			} else{
				return false;
			}
		})
	})
</script>

<body>
<form action="updateconsumer.do" method="post" id="updateForm" class="text">
<h2> Update Info </h2>
ID<br>
<input type="text" name="id" value="${sessionScope.cvo.id }" readonly=readonly><br>
PASSWORD<br>
<input type="password" name="password" ><br>
NAME<br>
<input type="text" name="name" value="${sessionScope.cvo.name }"><br>
ADDRESS<br>
<input type="text" name="address" value="${sessionScope.cvo.address }"><br>
<input type="submit" value="정보수정" class="submit">
</form>
<form action="deleteconsumer.do" method="post" id="deleteForm">
<input type="submit" value="회원탈퇴" class="submit">
</form>
</body>